/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbcuatrim")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbcuatrim.findAll", query = "SELECT p FROM Pyfntbcuatrim p"),
    @NamedQuery(name = "Pyfntbcuatrim.findByPyfntbcuatrimid", query = "SELECT p FROM Pyfntbcuatrim p WHERE p.pyfntbcuatrimid = :pyfntbcuatrimid"),
    @NamedQuery(name = "Pyfntbcuatrim.findByNombre", query = "SELECT p FROM Pyfntbcuatrim p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Pyfntbcuatrim.findByObservaciones", query = "SELECT p FROM Pyfntbcuatrim p WHERE p.observaciones = :observaciones")})
public class Pyfntbcuatrim implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbcuatrimid")
    private Integer pyfntbcuatrimid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbcuatrimid")
    private Collection<Pyfntbmeses> pyfntbmesesCollection;

    public Pyfntbcuatrim() {
    }

    public Pyfntbcuatrim(Integer pyfntbcuatrimid) {
        this.pyfntbcuatrimid = pyfntbcuatrimid;
    }

    public Pyfntbcuatrim(Integer pyfntbcuatrimid, String nombre, String observaciones) {
        this.pyfntbcuatrimid = pyfntbcuatrimid;
        this.nombre = nombre;
        this.observaciones = observaciones;
    }

    public Integer getPyfntbcuatrimid() {
        return pyfntbcuatrimid;
    }

    public void setPyfntbcuatrimid(Integer pyfntbcuatrimid) {
        this.pyfntbcuatrimid = pyfntbcuatrimid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pyfntbmeses> getPyfntbmesesCollection() {
        return pyfntbmesesCollection;
    }

    public void setPyfntbmesesCollection(Collection<Pyfntbmeses> pyfntbmesesCollection) {
        this.pyfntbmesesCollection = pyfntbmesesCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbcuatrimid != null ? pyfntbcuatrimid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbcuatrim)) {
            return false;
        }
        Pyfntbcuatrim other = (Pyfntbcuatrim) object;
        if ((this.pyfntbcuatrimid == null && other.pyfntbcuatrimid != null) || (this.pyfntbcuatrimid != null && !this.pyfntbcuatrimid.equals(other.pyfntbcuatrimid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbcuatrim[ pyfntbcuatrimid=" + pyfntbcuatrimid + " ]";
    }
    
}
